package com.example.blog.utils;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Hua YY
 * Date: 2025-01-06
 * Time: 17:50
 */

public class DateUtils {
    //封装方法，核心是使用SimpleDateFormat
    public static String dateFormat(Date date){
        //解释：简单的日期格式化
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        return simpleDateFormat.format(date);
    }

//      测试偷个懒
//    public static void main(String[] args) {
//        System.out.println(dateFormat(new Date()));
//    }

}
